package com.hg.miaosha.common.enums;

import lombok.Getter;

/**
 * 状态类型枚举
 */
@Getter
public enum StatusEnums {
	ENABLE(1, "启用"),
	UNABLE(0, "禁用"),
	DELETE(-1, "删除");


	private Integer code;
	private String message;

	StatusEnums(Integer code, String message) {
		this.code = code;
		this.message = message;
	}
	
	public static StatusEnums stateOf(int index) {
		for (StatusEnums state : values()) {
			if (state.getCode() == index) {
				return state;
			}
		}
		return null;
	}
}